<?php

namespace App\Providers;

use App\Http\Controllers\IndexController;
use Illuminate\Support\ServiceProvider;

class WecharServerProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        $indexCon = new IndexController();
        $class = get_class_methods(get_class($indexCon));
        view()->composer($class,function($view){
            $wechat = app('wechat');
            $js = $wechat->js;
            $view->with('js',$js);
        });
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
